﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using Castle.Windsor;
using Castle.MicroKernel.Registration;
using NUnit.Framework;
using NHibernate.Metadata;
using NHibernate.Cfg;

namespace BeardCoder.Data.Framework.NHibernate.TestBase
{
    [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple=true)]
    public class DevDbAttribute : Attribute, ITestAction
    {
        #region ITestAction

        public void BeforeTest(TestDetails details)
        {
            var testBase = (IDbTestBase)details.Fixture;
            testBase.SetUp();
        }

        public void AfterTest(TestDetails details)
        {
            var testBase = (IDbTestBase)details.Fixture;
            testBase.TearDown();
        }

        public ActionTargets Targets
        {
            get { return ActionTargets.Default; }
        }

        #endregion
    }
}
